<template>
    <!-- <div>封堵白名单</div> -->
    <a-row>
      <a-col>
        <a-card :bordered="false" style="margin-bottom: 10px">
          
          <div class="table-page-search-wrapper">
            <a-form-model ref="ruleForm" :model="pageFilter" :label-col="labelCol" :wrapper-col="wrapperCol">
              <a-row style="display:flex">
                <a-col :span="6">
                <a-form-model-item label="上报主题">
                    <a-input placeholder="请输入任务名称" />
                </a-form-model-item>
              </a-col>
                <a-col :span="6">
                <a-form-model-item label="诈骗类型" style="margin-left:0px">
                  <a-select style="width:100%">

                  </a-select>
                </a-form-model-item>
              </a-col>
                <a-col :span="6">
                <a-form-model-item label="上报时间" style="margin-left:0px">
                    <a-date-picker style="width:100%"/>
                </a-form-model-item>
              </a-col>
              </a-row>
                <a-form-model-item label="备注说明" :label-col="{ span: 2 }" >
                    <!-- <a-textarea placeholder="Autosize height based on content lines" style="width:100%"/> -->
                    <a-textarea placeholder="Controlled autosize" :auto-size="{ minRows: 3, maxRows: 10 }" />
                </a-form-model-item>
            </a-form-model>
          </div>
        </a-card>
        <a-card :bordered="false">
          <div>
            
            <z-table ref="table" rowKey="id" :showAlert="false" :showSelection="true" :loading="loading"
              :columns="columns" :dataSource="pageData" @selectedRowKey="onSelectedRow" @change="onTableChange">
            </z-table>
          </div>
          
        </a-card>
      </a-col>
    </a-row>
  </template>
  
  <script>
  export default {
    data () {
      return {
        show:false,
        labelCol: { span: 7 },
        wrapperCol: { span: 16 },
        loading: false,
        pageFilter: {
          pageNo: 1,
          pageSize: 10,
        },
        pageData: {
        },
        columns:[
          {
            title: '序号',
            dataIndex: 'order',
            width: 60,
            align: 'center',
            customRender: (text, record, index) =>
              `${(this.pageFilter.pageNo - 1) * this.pageFilter.pageSize + (index + 1)}` //序号分页后连续
          },
          {
            title: '类型',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '封堵地址',
            dataIndex: 'phone',
            align: 'center',
          },
          
        ]
      }
    },
    methods: {
      exportt(){},
      onQuery() {
        this.pageFilter.pageNo = 1
        this.refreshTable()
        console.log(this.pageData);
      },
      //重置
      onResetForm() {
        this.pageFilter = {
          pageNo: 1,
          pageSize: 10,
          departmentId: this.departmentId
        }
        this.refreshTable()
      },
      onSelectedRow(keys) {
        this.selectKeys = keys
        this.isDisabled = keys.length > 0 ? false : true
      },
      onTableChange(pagination, pageFilter, sorter) {
        let keyMap = { currentPage: 'pageNo' }
        let paginations = Object.keys(pagination).reduce((newData, key) => {
          let newKey = keyMap[key] || key
          newData[newKey] = pagination[key]
          return newData
        }, {})
        this.pageFilter = Object.assign({}, this.pageFilter, paginations)
        this.refreshTable()
      },
    }
  }
  </script>
  
  <style lang="less" scoped>
  .search-wrapper-btn {
    position: absolute;
    right: 20%;
    top: 22px;
    z-index: 100;
  }
  </style>